<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Goods;

class GoodsStatusController extends Controller
{
    public function update(Goods $goods, $type = 'status') {
    	$data = $goods->$type == 1? 0 : 1;
    	$goods->update([$type => $data]);
    	return response()->json(['status' => $data]);
    }
}
